home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / turbocadtest5_.vbs < prev    next >
Encoding:
Text File  |  2007-01-08  |  860 b   |  49 lines

  1. Option Explicit
  2.  
  3. Dim fso
  4. Dim f
  5. Dim FilePath
  6. Dim TextLine
  7.  
  8. Dim tcApp
  9. Dim ActiveDrawing
  10.  
  11. Sub LoadText()
  12.  
  13. Dim gxGrs
  14. Dim gxGr
  15.  
  16. Dim x
  17. Dim y
  18.  
  19.     x = 0
  20.     y = 0
  21.  
  22.     FilePath = WScript.ScriptFullName '"J:\TurboCADSDK\Program\VBA\LoadLine\mdlLoadLine.bas"
  23.     Set f = fso.OpenTextFile(FilePath, 1)
  24.     
  25.     MsgBox FilePath & " opened"
  26.  
  27.     Set gxGrs = ActiveDrawing.Graphics
  28.     Do While Not f.AtEndOfStream ' Loop until end of file.
  29.         TextLine = f.ReadLine
  30.     
  31.         Set gxGr = gxGrs.AddText(TextLine, x, y, 0, 10)
  32.         gxGr.Draw
  33.         y = y - 10
  34.     Loop
  35.     
  36.     f.Close    
  37.  
  38.     ActiveDrawing.ActiveView.ZoomToExtents
  39.  
  40.     MsgBox "Done"
  41.  
  42. End Sub
  43.  
  44.     Set fso = CreateObject("Scripting.FileSystemObject")
  45.  
  46.     Set tcApp = CreateObject("TurboCAD.Application")
  47.     Set ActiveDrawing = tcApp.ActiveDrawing
  48.     LoadText
  49.